home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / eev100r1.zip / TESTP.PAS < prev    next >
Pascal/Delphi Source File  |  1991-12-29  |  1KB  |  52 lines

  1. program TestP;
  2.  
  3. { This is a simple test program I used for POSTFIX.PAS }
  4.  
  5. Uses
  6.  
  7.   crt,
  8.   postfix;
  9.  
  10. var
  11.  
  12.   MyReal : real;
  13.   MyExpr : string;
  14.   MyErr,
  15.   MyBool : boolean;
  16.   MyAddr : Str20;
  17.  
  18. begin
  19.  
  20.   {init test variables}
  21.   MyReal := 0;
  22.   MyErr := false;
  23.  
  24.   {add 2 and 2 and put the result (4) in FRED}
  25.   MyAddr := 'FRED';
  26.   MyExpr := '2 2 +';
  27.   CalcAndStore(MyExpr,MyAddr,MyErr);
  28.  
  29.   {multiply 3 by 7 and put the result (21) in WILMA}
  30.   MyAddr := 'WILMA';
  31.   MyExpr := '3 7 *';
  32.   CalcAndStore(MyExpr,MyAddr,MyErr);
  33.  
  34.   {add FRED (4) and WILMA (21), subtract 1 (24), and store in DINO}
  35.   MyAddr := 'DINO';
  36.   MyExpr := 'FRED WILMA + 1 -';
  37.   CalcAndStore(MyExpr,MyAddr,MyErr);
  38.  
  39.   {look in DINO}
  40.   ReadVariable(MyAddr,MyReal,MyBool);
  41.  
  42.   if MyBool then
  43.     {couldn't find variable - this is leftover from testing w/o TD}
  44.     MyReal := -99999;
  45.  
  46.   {DINO has 24 in it here -- check for yourself using TD or writeln}
  47.  
  48.   {deallocate linked list's memory}
  49.   DestroyList;
  50.  
  51. end. {TestI}
  52.